# -*- coding:utf-8 -*-
"""
公共函数
"""
import socket


def getIp(host):
    if host == '127.0.0.1' or host == '0.0.0.0' or not host:
        """
        多个网卡，获取ip会有问题，固定写死
        笔记本名称 joyvw
        台式名称 admin-PC-zy
        """
        fh = open('./client.conf', 'r')
        host = fh.readline()
        fh.close()
    return host


def format_recv(ret_b):
    ret_b_list = [x + "}" for x in str(ret_b).split('}') if x]
    return ret_b_list
